package com.spider.Demo;

public class Test2 {
    public static void main(String[] args) {
        //猜数字游戏
        int number = (int)(Math.random()*100+1);
        int count = 0;
        while(true){
            count++;
            System.out.println("Input number:");
            int input = new java.util.Scanner(System.in).nextInt();
            if(input> number)
            {
                System.out.println("Too big!");
            }
            else if(input < number)
            {
                System.out.println("Too small!");
            }
            else
            {
                System.out.println("Congratulations! You TM are right!!!");
                break;
            }
        }
        System.out.println("You have guessed " + count + " times.");
    }
    
}
